/**
 * 
 */
package pt.inescid.components.console.commands;

import pt.inescid.components.console.Console;

/**
 * @author Sergio Esteves (sesteves at gsd.inesc-id.pt)
 *
 */
public class SetNMaxTasksCachedCommand extends Command {

	public static final String CMD_NAME = "set_max_ctasks";

	public SetNMaxTasksCachedCommand(Console console) {
		super(console);
	}
	
	@Override
	public void execute(String[] args) throws CommandException {	
		validateArgs(args, 2, 2);
		gridP2P.setNMaxCachedTasks(Integer.parseInt(args[1]));
	}

	@Override
	public String getCmdName() {
		return CMD_NAME;
	}

	@Override
	public String synopsis() {
		return CMD_NAME + SYNTAX_SEPARATOR +
			"sets the maximum number of cached tasks";
	}
}
